.class Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;
.super Lcom/burstly/lib/util/PrioritizedAsyncTask;
.source "RequestManager.java"

# interfaces
.implements Lcom/burstly/lib/network/request/IAbortableRequest;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/burstly/lib/network/request/RequestManager;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0xa
    name = "LoadResponseTask"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/burstly/lib/util/PrioritizedAsyncTask",
        "<",
        "Lcom/burstly/lib/network/beans/ResponseBean;",
        ">;",
        "Lcom/burstly/lib/network/request/IAbortableRequest;"
    }
.end annotation


# instance fields
.field private volatile mAborted:Z

.field private final mCallback:Lcom/burstly/lib/network/request/IRequestCallback;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/burstly/lib/network/request/IRequestCallback",
            "<",
            "Lcom/burstly/lib/network/beans/ResponseBean;",
            ">;"
        }
    .end annotation
.end field

.field private mRequest:Lcom/burstly/lib/network/request/IAbortableRequest;

.field private final mRequestManager:Lcom/burstly/lib/network/request/RequestManager;

.field private final mRequestObject:Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/burstly/lib/network/request/RequestManager$RequestDataObject",
            "<",
            "Lcom/burstly/lib/network/beans/ResponseBean;",
            ">;"
        }
    .end annotation
.end field

.field private final mResponseSaver:Lcom/burstly/lib/persistance/ResponseSaver;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/burstly/lib/persistance/ResponseSaver",
            "<",
            "Lcom/burstly/lib/network/beans/ResponseBean;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method constructor <init>(Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;Lcom/burstly/lib/persistance/ResponseSaver;Lcom/burstly/lib/network/request/RequestManager;)V
    .locals 1
    .parameter
    .parameter
    .parameter "requestMgr"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/burstly/lib/network/request/RequestManager$RequestDataObject",
            "<",
            "Lcom/burstly/lib/network/beans/ResponseBean;",
            ">;",
            "Lcom/burstly/lib/persistance/ResponseSaver",
            "<",
            "Lcom/burstly/lib/network/beans/ResponseBean;",
            ">;",
            "Lcom/burstly/lib/network/request/RequestManager;",
            ")V"
        }
    .end annotation

    .prologue
    .line 193
    .local p1, requestObject:Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;,"Lcom/burstly/lib/network/request/RequestManager$RequestDataObject<Lcom/burstly/lib/network/beans/ResponseBean;>;"
    .local p2, responseSaver:Lcom/burstly/lib/persistance/ResponseSaver;,"Lcom/burstly/lib/persistance/ResponseSaver<Lcom/burstly/lib/network/beans/ResponseBean;>;"
    invoke-direct {p0}, Lcom/burstly/lib/util/PrioritizedAsyncTask;-><init>()V

    .line 194
    iput-object p1, p0, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->mRequestObject:Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;

    .line 195
    iput-object p2, p0, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->mResponseSaver:Lcom/burstly/lib/persistance/ResponseSaver;

    .line 196
    iget-object v0, p1, Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    iput-object v0, p0, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    .line 197
    iput-object p3, p0, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->mRequestManager:Lcom/burstly/lib/network/request/RequestManager;

    .line 198
    return-void
.end method


# virtual methods
.method public abortRequest()V
    .locals 1

    .prologue
    .line 242
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->mAborted:Z

    .line 243
    iget-object v0, p0, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->mRequest:Lcom/burstly/lib/network/request/IAbortableRequest;

    if-eqz v0, :cond_0

    .line 244
    iget-object v0, p0, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->mRequest:Lcom/burstly/lib/network/request/IAbortableRequest;

    invoke-interface {v0}, Lcom/burstly/lib/network/request/IAbortableRequest;->abortRequest()V

    .line 246
    :cond_0
    return-void
.end method

.method protected onPostExecute(Lcom/burstly/lib/network/beans/ResponseBean;)V
    .locals 2
    .parameter "result"

    .prologue
    .line 231
    iget-boolean v0, p0, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->mAborted:Z

    if-nez v0, :cond_0

    .line 232
    if-eqz p1, :cond_1

    .line 233
    iget-object v0, p0, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    invoke-interface {v0, p1}, Lcom/burstly/lib/network/request/IRequestCallback;->onSuccessUi(Ljava/lang/Object;)V

    .line 238
    :cond_0
    :goto_0
    return-void

    .line 235
    :cond_1
    iget-object v0, p0, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->mRequestManager:Lcom/burstly/lib/network/request/RequestManager;

    iget-object v1, p0, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->mRequestObject:Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;

    invoke-virtual {v0, v1}, Lcom/burstly/lib/network/request/RequestManager;->makeAdRequest(Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;)Lcom/burstly/lib/network/request/IAbortableRequest;

    move-result-object v0

    iput-object v0, p0, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->mRequest:Lcom/burstly/lib/network/request/IAbortableRequest;

    goto :goto_0
.end method

.method protected bridge synthetic onPostExecute(Ljava/lang/Object;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 152
    check-cast p1, Lcom/burstly/lib/network/beans/ResponseBean;

    .end local p1
    invoke-virtual {p0, p1}, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->onPostExecute(Lcom/burstly/lib/network/beans/ResponseBean;)V

    return-void
.end method

.method protected performInBackground()Lcom/burstly/lib/network/beans/ResponseBean;
    .locals 3

    .prologue
    .line 217
    iget-object v1, p0, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->mResponseSaver:Lcom/burstly/lib/persistance/ResponseSaver;

    invoke-virtual {v1}, Lcom/burstly/lib/persistance/ResponseSaver;->loadLastResponse()Ljava/io/Serializable;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/network/beans/ResponseBean;

    .line 218
    .local v0, loadedLastResponse:Lcom/burstly/lib/network/beans/ResponseBean;
    iget-boolean v1, p0, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->mAborted:Z

    if-nez v1, :cond_0

    .line 219
    if-eqz v0, :cond_1

    .line 220
    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/burstly/lib/network/beans/ResponseBean;->setIsLoadedFromCache(Z)V

    .line 221
    iget-object v1, p0, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    invoke-interface {v1, v0}, Lcom/burstly/lib/network/request/IRequestCallback;->onSuccessInBackground(Ljava/lang/Object;)V

    .line 226
    :cond_0
    :goto_0
    return-object v0

    .line 223
    :cond_1
    iget-object v1, p0, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    const/4 v2, 0x0

    invoke-interface {v1, v2}, Lcom/burstly/lib/network/request/IRequestCallback;->onFailInBackground(Ljava/lang/Object;)V

    goto :goto_0
.end method

.method protected bridge synthetic performInBackground()Ljava/lang/Object;
    .locals 1

    .prologue
    .line 152
    invoke-virtual {p0}, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->performInBackground()Lcom/burstly/lib/network/beans/ResponseBean;

    move-result-object v0

    return-object v0
.end method
